home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2005 June / SAN CD 6 2005 CD-ROM 1.iso / pc / media / Gallery.swf / scripts / frame_1 / DoAction.as
Encoding:
Text File  |  2005-04-19  |  6.1 KB  |  122 lines

  1. var a_AUTHORS = ["Alan Tough","Anthony Ayiomamitis","David Nash","David Storey","Derrick Farley","Eric Walker","Geoff Smith","Iain Moore","Keith Johnson","Kevin McCarthy","Lilian Hobbs","Paul Buglass","Steve Reid and Brian Woosam","Steve and Sue Reid","Sue Reid","Tony Ireland"];
  2. var a_TAGID = [[0,"Full Moon","26 November 2004"],[1,"Aristarchus Plateau","25 October 2004"],[1,"Crater Janssen with rima","31 October 2004"],[1,"Messier and Messier A crater twins","30 October 2004"],[1,"Rupes Altai","3 October 2004"],[1,"Solar analemma over Tholos, Greece","2002"],[1,"Solar analemma over The Parthenon, Greece","2002"],[2,"Vallis Rheita","30 October 2004"],[2,"Full Moon","25 April 2005"],[2,"Orion Nebula","12 February 2005"],[3,"Straight Wall region of the Moon","19 March 2005"],[4,"M101","6 March 2005"],[5,"Crescent Moon & Mare Crisium","13 March 2005"],[5,"Sun pillar","19 March 2005"],[6,"M81 and M82","March 2005"],[6,"Trio of galaxies in Leo","2005"],[6,"M51","March 2005"],[7,"M3 globular cluster","October 2004"],[7,"M42",""],[7,"Waning gibbous Moon",""],[8,"Jupiter","March 2005"],[8,"Saturn","March 2005"],[9,"Clavius",""],[10,"Saturn","20 March 2005"],[11,"Messier 13 - Hercules Globular Cluster","5 April 2005"],[12,"M45 and Comet Machholz","5 April 2005"],[13,"M104","17 March 2005"],[13,"NGC 891","21 September 2004"],[14,"The Eskimo Nebula","19 December 2004"],[15,"The Moon","21 January 2005"]];
  3. var a_EQUIP = ["Canon PowerShot S45 digital camera and a 90mm Vixen refractor. ","Philips Toucam PCVC 740k and a Celestron 14\" SCT/f11","Philips Toucam PCVC 740k and a Celestron 14\" SCT/f11","Philips Toucam PCVC 740k and a Celestron 14\" SCT/f11","Philips Toucam PCVC 740k and a Celestron 14\" SCT/f11","Canon A-1, Canon FD 24 mm @ f/11, Baadar Solar Filter ND5","Canon A-1, Canon FD 24 mm @ f/11, Baadar Solar Filter ND5","Philips Toucam PCVC 740k and a Celestron 14\" SCT/f11","Philips Toucam Pro and Europa 250 f/4.8 Newtonian telescope","Logitech QuickCam 3000 and a 135mm SLR lens","Philips Toucam and 16\" Meade Reflector","ST-10XME through an RCOS Ritchey Chretien 12.5\" telescope at f/9","Nikon Coolpix 5700 digital camera on a 114mm reflector telescope","Nikon Coolpix 5700","SX MX916 and a Takahashi FS60c","SX MX916 and a Takahashi FS60c","SX MX916 and a Takahashi FS60c","Skywatcher Explorer 200 newtonian scope and modified webcam","","","Philips Toucam Pro","Philips Toucam Pro","Philips Toucam Pro and a 127mm Mak/Cass","Philips Toucam Pro on a 7\"TMB and a 5x Televue Powermate","Modified Philips Vesta Pro webcam and Celestron Celstar 8\" F10 SCT","Starlite Express MX 7c CCD + adapted zoom lens through a 12 inch Meade LX 200","Starlite Express MX 7c CCD through a 12-inch Meade LX 200","Starlite Express MX 7c CCD through a 12-inch Meade LX 200","Starlite Express MX 7c CCD through a 12-inch Meade LX 200","Fuji 700 digital camera and a Meade ETX-90"];
  4. var i_THMCNT = 31;
  5. var i_GRID = 4;
  6. var i_MARG = 10;
  7. var i_MAXTH = 12;
  8. var i_TBTNW = 152 + i_MARG;
  9. var b_PLOAD = b_PLODD = 0;
  10. loadThumbs = function()
  11. {
  12.    var i_PAGE = i_PAGE * i_MAXTH > i_THMCNT ? (i_PAGE = 1) : (i_PAGE += 1);
  13.    j = 1;
  14.    while(j <= i_MAXTH)
  15.    {
  16.       var i_PAGEN = (i_PAGE - 1) * i_MAXTH + j;
  17.       PNUM = "Page " + i_PAGE + "/" + Math.round(i_THMCNT / i_MAXTH) + ")";
  18.       duplicateMovieClip(MCT,"MCT" + j,16384 + j);
  19.       eval("MCT" + j).loadMovie("RES/Gallery/t" + i_PAGEN + ".jpg");
  20.       eval("MCT" + j)._x += Math.round(i_TBTNW * j - i_TBTNW * i_GRID * Math.floor((j - 1) / i_GRID) - i_TBTNW);
  21.       eval("MCT" + j)._y += Math.round(i_TBTNW * Math.floor((j - 1) / i_GRID));
  22.       eval("MCT" + j)._alpha = 75;
  23.       duplicateMovieClip(THMBTTN,"TBTN" + i_PAGEN,16384 + (i_MAXTH * 2 + j));
  24.       eval("TBTN" + i_PAGEN)._x = eval("MCT" + j)._x;
  25.       eval("TBTN" + i_PAGEN)._y = eval("MCT" + j)._y;
  26.       eval("TBTN" + i_PAGEN).NUM = i_PAGEN;
  27.       createEmptyMovieClip(eval("BMCT" + j),i_MAXTH + j);
  28.       tellTarget(eval("BMCT" + j))
  29.       {
  30.          lineStyle(0,16763904,100);
  31.          moveTo(eval("MCT" + j)._x - 1,eval("MCT" + j)._y - 1);
  32.          lineTo(eval("MCT" + j)._x + 151,eval("MCT" + j)._y - 1);
  33.          lineTo(eval("MCT" + j)._x + 151,eval("MCT" + j)._y + 151);
  34.          lineTo(eval("MCT" + j)._x - 1,eval("MCT" + j)._y + 151);
  35.          lineTo(eval("MCT" + j)._x - 1,eval("MCT" + j)._y - 1);
  36.       }
  37.       if(i_PAGEN >= i_THMCNT)
  38.       {
  39.          tellTarget(eval("BMCT" + j))
  40.          {
  41.             clear;
  42.          }
  43.          eval("TBTN" + i_PAGEN).NUM = "";
  44.          removeMovieClip("TBTN" + i_PAGEN);
  45.          removeMovieClip("BMCT" + j);
  46.          removeMovieClip("MCT" + j);
  47.       }
  48.       j++;
  49.    }
  50.    MCT._visible = 0;
  51.    TBTN._visible = 0;
  52. };
  53. loadImage = function(i_ID)
  54. {
  55.    togBut(0);
  56.    this.createEmptyMovieClip("PRINTR",50);
  57.    PRINTR.loadMovie("printexplorer.swf");
  58.    PRINTR._x = PRINTR._y = 0;
  59.    i_CID = i_ID;
  60.    b_PLODD = 1;
  61. };
  62. this.onEnterFrame = function()
  63. {
  64.    b_PLOAD = Boolean(PRINTR.MCFIMG._width);
  65.    if(b_PLOAD && b_PLODD)
  66.    {
  67.       _global.loadImg(i_CID,"Gallery",a_AUTHORS[a_TAGID[i_CID - 1][0]],a_EQUIP[i_CID - 1],a_TAGID[i_CID - 1][2],a_TAGID[i_CID - 1][1]);
  68.       b_PLODD = 0;
  69.    }
  70.    updateAfterEvent();
  71. };
  72. unloadPP = function()
  73. {
  74.    removeMovieClip("PRINTR");
  75.    togBut(1);
  76. };
  77. togBut = function(i_ENBLD)
  78. {
  79.    PRNTBTN._visible = i_ENBLD;
  80.    TXTMES._visible = i_ENBLD;
  81.    i = 1;
  82.    while(i <= i_THMCNT)
  83.    {
  84.       eval("TBTN" + i).HBTN.enabled = i_ENBLD;
  85.       i++;
  86.    }
  87. };
  88. dimThumb = function(i_NUM, b_THIS)
  89. {
  90.    i_NUM = i_NUM <= i_MAXTH ? i_NUM : i_NUM - i_MAXTH * Math.floor((i_NUM - 1) / i_MAXTH);
  91.    i = 1;
  92.    while(i <= 12)
  93.    {
  94.       if(b_THIS && i != i_NUM)
  95.       {
  96.          eval("MCT" + i)._alpha = 75;
  97.       }
  98.       else if(i == i_NUM)
  99.       {
  100.          eval("MCT" + i)._alpha = 100;
  101.       }
  102.       i++;
  103.    }
  104. };
  105. setBG = function()
  106. {
  107.    beginFill(0,100);
  108.    moveTo(0,0);
  109.    lineTo(800,0);
  110.    lineTo(800,500);
  111.    lineTo(0,500);
  112.    lineTo(0,0);
  113.    endFill();
  114. };
  115. MovieClip.prototype.playDir = function()
  116. {
  117.    bDir = !this.isForw ? -1 : 1;
  118.    this.gotoAndStop(this._currentframe + bDir);
  119. };
  120. setBG();
  121. loadThumbs();
  122.